package cn.edu.sdjzu.xg.bysj.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

@Slf4j
@Setter
@Getter
@AllArgsConstructor
@ToString
public final class GraduateProject implements Comparable<GraduateProject>,Serializable{
	private Integer id;

	private String title;

	private double score;

	private int year;
	//毕设种类
	private GraduateProjectCategory graduateProjectCategory;
	//毕设类型
	private GraduateProjectType graduateProjectType;

	private GraduateProjectStatus graduateProjectStatus;

	private GraduateProjectSource graduateProjectSource;

	private GraduateProjectTrueness graduateProjectTrueness;

	private Teacher teacher;

	private Student student;

	private GraduateProject(
			String title,double score,GraduateProjectCategory graduateProjectCategory,
			GraduateProjectType graduateProjectType,GraduateProjectStatus graduateProjectStatus,
			GraduateProjectSource graduateProjectSource,GraduateProjectTrueness graduateProjectTrueness,
			Student student,Teacher teacher,int year){
		this.score = score;
		this.title = title;
		this.year = year;
		this.graduateProjectCategory = graduateProjectCategory;
		this.graduateProjectType = graduateProjectType;
		this.graduateProjectStatus = graduateProjectStatus;
		this.graduateProjectSource = graduateProjectSource;
		this.graduateProjectTrueness = graduateProjectTrueness;
		this.student = student;
		this.teacher = teacher;
	}

	@Override
	public int compareTo(GraduateProject o) {
		// TODO Auto-generated method stub
		return this.id-o.id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final GraduateProject other = (GraduateProject) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}
